package ooday04;

public class EnumTimeDemo {
    public static void main(String[] args) {
        Time t1 = Time.NIGHT;
        switch (t1){
            case MORNING:
                System.out.println("现在是早上，该"+t1.getActivity()+"，还有"+t1.getHours()+"小时到中午");
                break;
            case MIDDAY:
                System.out.println("现在是中午，该"+t1.getActivity()+"，还有"+t1.getHours()+"小时到下午");
                break;
            case AFTERNOON:
                System.out.println("现在是下午，该"+t1.getActivity()+"，还有"+t1.getHours()+"小时到晚上");
                break;
            case NIGHT:
                System.out.println("现在是晚上，该"+t1.getActivity()+"，还有"+t1.getHours()+"小时到早上");
                break;
        }
        Time[]times = Time.values();
        for(int j = 0; j < times.length;j++ ){
            System.out.println(times[j]);
            System.out.println(times[j].getActivity());
            System.out.println(times[j].getHours());
        }
    }
}
